package ch.simplix.android.net.discoverer.wifi;

import java.util.Vector;


/**
 * Describes a measurement containing several readings from the bluetooth-Discoverer
	@author SimpliX
 */
public class WiFiMeasurement {

	
	

	/* time of measurment */
	protected long timestamp = 0;
	
	/* set of WiFiReading readings that where taken during the measurement */
	protected Vector<WiFiReading> wifiReadings;

	/* constructor */
	public WiFiMeasurement() {
		this(new Vector<WiFiReading>());
		
	}
	
	public WiFiMeasurement(Vector<WiFiReading> wifiReadings) {
		timestamp = System.currentTimeMillis();		
		this.wifiReadings = wifiReadings;
	}


	/* ************ Getter and Setter Methods ************ */

	/**
	 * @return the timestamp
	 */
	public long getTimestamp() {
		return timestamp;
	}

	/**
	 * @param timestamp
	 *            the timestamp to set
	 */
	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	
	/**
	 * @return the wiFi readings
	 */
	public Vector<WiFiReading> getWiFiReadings() {
		return wifiReadings;
	}
	public void setWiFiReadings(Vector<WiFiReading> wiFiReadings) {
		this.wifiReadings = wiFiReadings;
	}

	public void addWiFiReading(WiFiReading wiFiReading) {
		this.wifiReadings.addElement(wiFiReading);
	}
	@Override
	public String toString() {
		String toString="";		
		if(wifiReadings!=null)
			for(WiFiReading wiFiReading:this.wifiReadings)
			{
				toString+=wiFiReading+"\n";
			}
		
		return toString;
	}
}
